<html>
<body>

<?
include_once("config.php");
session_start();

$userName=$_POST['userName']; 
$password=$_POST['password'];

$userRepo = new UserRepo();
$userConfig = array(
	name => $userName,
	password =>$password);
	
print_r($userConfig);
	
$userRepo->add($userConfig);
$userRepo->commit();
$user = $userRepo->getByName($userName);

if ($user)
{
	$_SESSION["user"] = $user;
	header("location:chooseteam.php");
}
else
{
	echo "REGISTER FAILED";
	//header("location:default.php");
}
?>

</body>
</html>